using UnityEngine;
using System.Collections;

public class Button : MonoBehaviour {

	// Use this for initialization
	void Start () {
	}
	
	// Update is called once per frame
	void Update () {
		RaycastHit Hit;
		
		if(!Input.GetMouseButton(0))
			return;

		var ray = Camera.main.ScreenPointToRay(Input.mousePosition);

		if(Physics.Raycast(ray, out Hit, 100))
		{
			var tag = Hit.transform.tag;
			print("Hit:" + tag);
			print("position" + Hit.transform.position);
			Debug.DrawRay(ray.origin, Hit.point, Color.red);

/*			if(tag == "startButton")
			{
				Application.loadedLevel("Hungry");
			}*/
		}
	}
}
